<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="用户id" prop="userid">
        <el-input
          v-model="queryParams.userid"
          placeholder="请输入用户id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工作流节点id" prop="wid">
        <el-input
          v-model="queryParams.wid"
          placeholder="请输入工作流节点id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="nname">
        <el-input
          v-model="queryParams.nname"
          placeholder="请输入项目名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="主编单位" prop="eunit">
        <el-input
          v-model="queryParams.eunit"
          placeholder="请输入主编单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计划完成时间" prop="pctm">
        <el-date-picker clearable size="small" style="width: 200px"
          v-model="queryParams.pctm"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择计划完成时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="主要起草人" prop="ld">
        <el-input
          v-model="queryParams.ld"
          placeholder="请输入主要起草人"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参与起草单位/参编单位" prop="partUnit">
        <el-input
          v-model="queryParams.partUnit"
          placeholder="请输入参与起草单位/参编单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="主要起草人职务" prop="ldp">
        <el-input
          v-model="queryParams.ldp"
          placeholder="请输入主要起草人职务"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="申报单位是否原主编或参编单位" prop="isHostUnit">
        <el-input
          v-model="queryParams.isHostUnit"
          placeholder="请输入申报单位是否原主编或参编单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="主要起草人工作单位" prop="ldu">
        <el-input
          v-model="queryParams.ldu"
          placeholder="请输入主要起草人工作单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="projectName">
        <el-input
          v-model="queryParams.projectName"
          placeholder="请输入项目名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="关键词" prop="keyword">
        <el-input
          v-model="queryParams.keyword"
          placeholder="请输入关键词"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="专业门类选择" prop="majorValue">
        <el-input
          v-model="queryParams.majorValue"
          placeholder="请输入专业门类选择"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="功能序列选择" prop="functionValue">
        <el-input
          v-model="queryParams.functionValue"
          placeholder="请输入功能序列选择"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="标准性质" prop="standardNature">
        <el-input
          v-model="queryParams.standardNature"
          placeholder="请输入标准性质"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="标准状态" prop="standardStatus">
        <el-select v-model="queryParams.standardStatus" placeholder="请选择标准状态" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="项目英文名称" prop="enName">
        <el-input
          v-model="queryParams.enName"
          placeholder="请输入项目英文名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="制定或修订" prop="tp">
        <el-input
          v-model="queryParams.tp"
          placeholder="请输入制定或修订"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="被修订标准号" prop="standardNo">
        <el-input
          v-model="queryParams.standardNo"
          placeholder="请输入被修订标准号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目承担单位" prop="hostUnit">
        <el-input
          v-model="queryParams.hostUnit"
          placeholder="请输入项目承担单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计划完成时间" prop="planTime">
        <el-date-picker clearable size="small" style="width: 200px"
          v-model="queryParams.planTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择计划完成时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="项目负责人" prop="pi">
        <el-input
          v-model="queryParams.pi"
          placeholder="请输入项目负责人"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职务" prop="post">
        <el-input
          v-model="queryParams.post"
          placeholder="请输入职务"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电话" prop="tel">
        <el-input
          v-model="queryParams.tel"
          placeholder="请输入电话"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="邮件" prop="email">
        <el-input
          v-model="queryParams.email"
          placeholder="请输入邮件"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目承担单位意见" prop="hostUnitOpinion">
        <el-input
          v-model="queryParams.hostUnitOpinion"
          placeholder="请输入项目承担单位意见"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="行政主管部门意见" prop="authUnitOpinion">
        <el-input
          v-model="queryParams.authUnitOpinion"
          placeholder="请输入行政主管部门意见"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="深圳市住房和建设局" prop="mainUnitOpinion">
        <el-input
          v-model="queryParams.mainUnitOpinion"
          placeholder="请输入深圳市住房和建设局"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="标准规范种类" prop="stdTp">
        <el-input
          v-model="queryParams.stdTp"
          placeholder="请输入标准规范种类"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="原主编单位意见(若非原主编单位)" prop="exOpinion">
        <el-input
          v-model="queryParams.exOpinion"
          placeholder="请输入原主编单位意见(若非原主编单位)"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="标准规范立项单位" prop="stdUnit">
        <el-input
          v-model="queryParams.stdUnit"
          placeholder="请输入标准规范立项单位"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="目的、意义及必要性" prop="goalDesc">
        <el-input
          v-model="queryParams.goalDesc"
          placeholder="请输入目的、意义及必要性"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="立项通知流程的当前状态(待办、退回、办理中、已完成)" prop="wStatus">
        <el-select v-model="queryParams.wStatus" placeholder="请选择立项通知流程的当前状态(待办、退回、办理中、已完成)" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="国内外情况简要说明/涵盖范围和主要内容说明" prop="infosDesc">
        <el-input
          v-model="queryParams.infosDesc"
          placeholder="请输入国内外情况简要说明/涵盖范围和主要内容说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="范围和主要技术内容" prop="techDesc">
        <el-input
          v-model="queryParams.techDesc"
          placeholder="请输入范围和主要技术内容"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="可行性分析" prop="analysisDesc">
        <el-input
          v-model="queryParams.analysisDesc"
          placeholder="请输入可行性分析"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否涉及专利等知识产权问题" prop="propertyDesc">
        <el-input
          v-model="queryParams.propertyDesc"
          placeholder="请输入是否涉及专利等知识产权问题"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="主编单位资格条件情况说明" prop="hostUnitDesc">
        <el-input
          v-model="queryParams.hostUnitDesc"
          placeholder="请输入主编单位资格条件情况说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="有无国家、本省本市法律法规、规范、政策和重点工作部署相关依据的情况说明" prop="lawDesc">
        <el-input
          v-model="queryParams.lawDesc"
          placeholder="请输入有无国家、本省本市法律法规、规范、政策和重点工作部署相关依据的情况说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="有无相关国家标准、行业标准、地方标准情况说明" prop="stdDesc">
        <el-input
          v-model="queryParams.stdDesc"
          placeholder="请输入有无相关国家标准、行业标准、地方标准情况说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="与国内相关标准对标情况的综合说明" prop="countryDesc">
        <el-input
          v-model="queryParams.countryDesc"
          placeholder="请输入与国内相关标准对标情况的综合说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="与国际相关标准对标情况的综合说明" prop="foreignDesc">
        <el-input
          v-model="queryParams.foreignDesc"
          placeholder="请输入与国际相关标准对标情况的综合说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="对标或借鉴的国际、国外或区域性" prop="foreignStdList">
        <el-input
          v-model="queryParams.foreignStdList"
          placeholder="请输入对标或借鉴的国际、国外或区域性"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="涉及的科研成果鉴定、验证或认可情况说明" prop="achievementDesc">
        <el-input
          v-model="queryParams.achievementDesc"
          placeholder="请输入涉及的科研成果鉴定、验证或认可情况说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="先进性、创新性和因地制宜等情况说明" prop="advanceDesc">
        <el-input
          v-model="queryParams.advanceDesc"
          placeholder="请输入先进性、创新性和因地制宜等情况说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工作经费安排情况说明" prop="fundsDesc">
        <el-input
          v-model="queryParams.fundsDesc"
          placeholder="请输入工作经费安排情况说明"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="cyan"  size="mini" @click="handleQuery">搜索</el-button>
        <el-button size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="20" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['standard:m:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['standard:m:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['standard:m:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['standard:m:export']"
        >导出</el-button>
      </el-col>
	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="mList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="left" />
      <el-table-column label="项目唯一标识符" align="left" prop="nid" />
      <el-table-column label="用户id" align="left" prop="userid" />
      <el-table-column label="工作流节点id" align="left" prop="wid" />
      <el-table-column label="项目名称" align="left" prop="nname" />
      <el-table-column label="主编单位" align="left" prop="eunit" />
      <el-table-column label="计划完成时间" align="left" prop="pctm" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.pctm, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="主要起草人" align="left" prop="ld" />
      <el-table-column label="参与起草单位/参编单位" align="left" prop="partUnit" />
      <el-table-column label="主要起草人职务" align="left" prop="ldp" />
      <el-table-column label="申报单位是否原主编或参编单位" align="left" prop="isHostUnit" />
      <el-table-column label="主要起草人工作单位" align="left" prop="ldu" />
      <el-table-column label="项目名称" align="left" prop="projectName" />
      <el-table-column label="关键词" align="left" prop="keyword" />
      <el-table-column label="专业门类选择" align="left" prop="majorValue" />
      <el-table-column label="功能序列选择" align="left" prop="functionValue" />
      <el-table-column label="标准性质" align="left" prop="standardNature" />
      <el-table-column label="标准状态" align="left" prop="standardStatus" />
      <el-table-column label="项目英文名称" align="left" prop="enName" />
      <el-table-column label="制定或修订" align="left" prop="tp" />
      <el-table-column label="被修订标准号" align="left" prop="standardNo" />
      <el-table-column label="项目承担单位" align="left" prop="hostUnit" />
      <el-table-column label="计划完成时间" align="left" prop="planTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.planTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="项目负责人" align="left" prop="pi" />
      <el-table-column label="职务" align="left" prop="post" />
      <el-table-column label="电话" align="left" prop="tel" />
      <el-table-column label="邮件" align="left" prop="email" />
      <el-table-column label="项目承担单位意见" align="left" prop="hostUnitOpinion" />
      <el-table-column label="行政主管部门意见" align="left" prop="authUnitOpinion" />
      <el-table-column label="深圳市住房和建设局" align="left" prop="mainUnitOpinion" />
      <el-table-column label="标准规范种类" align="left" prop="stdTp" />
      <el-table-column label="原主编单位意见(若非原主编单位)" align="left" prop="exOpinion" />
      <el-table-column label="标准规范立项单位" align="left" prop="stdUnit" />
      <el-table-column label="目的、意义及必要性" align="left" prop="goalDesc" />
      <el-table-column label="立项通知流程的当前状态(待办、退回、办理中、已完成)" align="left" prop="wStatus" />
      <el-table-column label="国内外情况简要说明/涵盖范围和主要内容说明" align="left" prop="infosDesc" />
      <el-table-column label="范围和主要技术内容" align="left" prop="techDesc" />
      <el-table-column label="可行性分析" align="left" prop="analysisDesc" />
      <el-table-column label="是否涉及专利等知识产权问题" align="left" prop="propertyDesc" />
      <el-table-column label="主编单位资格条件情况说明" align="left" prop="hostUnitDesc" />
      <el-table-column label="有无国家、本省本市法律法规、规范、政策和重点工作部署相关依据的情况说明" align="left" prop="lawDesc" />
      <el-table-column label="有无相关国家标准、行业标准、地方标准情况说明" align="left" prop="stdDesc" />
      <el-table-column label="与国内相关标准对标情况的综合说明" align="left" prop="countryDesc" />
      <el-table-column label="与国际相关标准对标情况的综合说明" align="left" prop="foreignDesc" />
      <el-table-column label="对标或借鉴的国际、国外或区域性" align="left" prop="foreignStdList" />
      <el-table-column label="涉及的科研成果鉴定、验证或认可情况说明" align="left" prop="achievementDesc" />
      <el-table-column label="先进性、创新性和因地制宜等情况说明" align="left" prop="advanceDesc" />
      <el-table-column label="工作经费安排情况说明" align="left" prop="fundsDesc" />
      <el-table-column label="操作" align="left" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['standard:m:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['standard:m:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改立项通知（市监）对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="用户id" prop="userid">
          <el-input v-model="form.userid" placeholder="请输入用户id" />
        </el-form-item>
        <el-form-item label="工作流节点id" prop="wid">
          <el-input v-model="form.wid" placeholder="请输入工作流节点id" />
        </el-form-item>
        <el-form-item label="项目名称" prop="nname">
          <el-input v-model="form.nname" placeholder="请输入项目名称" />
        </el-form-item>
        <el-form-item label="主编单位" prop="eunit">
          <el-input v-model="form.eunit" placeholder="请输入主编单位" />
        </el-form-item>
        <el-form-item label="计划完成时间" prop="pctm">
          <el-date-picker clearable size="small" style="width: 200px"
            v-model="form.pctm"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择计划完成时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="主要起草人" prop="ld">
          <el-input v-model="form.ld" placeholder="请输入主要起草人" />
        </el-form-item>
        <el-form-item label="参与起草单位/参编单位" prop="partUnit">
          <el-input v-model="form.partUnit" placeholder="请输入参与起草单位/参编单位" />
        </el-form-item>
        <el-form-item label="主要起草人职务" prop="ldp">
          <el-input v-model="form.ldp" placeholder="请输入主要起草人职务" />
        </el-form-item>
        <el-form-item label="申报单位是否原主编或参编单位" prop="isHostUnit">
          <el-input v-model="form.isHostUnit" placeholder="请输入申报单位是否原主编或参编单位" />
        </el-form-item>
        <el-form-item label="主要起草人工作单位" prop="ldu">
          <el-input v-model="form.ldu" placeholder="请输入主要起草人工作单位" />
        </el-form-item>
        <el-form-item label="项目名称" prop="projectName">
          <el-input v-model="form.projectName" placeholder="请输入项目名称" />
        </el-form-item>
        <el-form-item label="关键词" prop="keyword">
          <el-input v-model="form.keyword" placeholder="请输入关键词" />
        </el-form-item>
        <el-form-item label="专业门类选择" prop="majorValue">
          <el-input v-model="form.majorValue" placeholder="请输入专业门类选择" />
        </el-form-item>
        <el-form-item label="功能序列选择" prop="functionValue">
          <el-input v-model="form.functionValue" placeholder="请输入功能序列选择" />
        </el-form-item>
        <el-form-item label="标准性质" prop="standardNature">
          <el-input v-model="form.standardNature" placeholder="请输入标准性质" />
        </el-form-item>
        <el-form-item label="标准状态">
          <el-radio-group v-model="form.standardStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="项目英文名称" prop="enName">
          <el-input v-model="form.enName" placeholder="请输入项目英文名称" />
        </el-form-item>
        <el-form-item label="制定或修订" prop="tp">
          <el-input v-model="form.tp" placeholder="请输入制定或修订" />
        </el-form-item>
        <el-form-item label="被修订标准号" prop="standardNo">
          <el-input v-model="form.standardNo" placeholder="请输入被修订标准号" />
        </el-form-item>
        <el-form-item label="项目承担单位" prop="hostUnit">
          <el-input v-model="form.hostUnit" placeholder="请输入项目承担单位" />
        </el-form-item>
        <el-form-item label="计划完成时间" prop="planTime">
          <el-date-picker clearable size="small" style="width: 200px"
            v-model="form.planTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择计划完成时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="项目负责人" prop="pi">
          <el-input v-model="form.pi" placeholder="请输入项目负责人" />
        </el-form-item>
        <el-form-item label="职务" prop="post">
          <el-input v-model="form.post" placeholder="请输入职务" />
        </el-form-item>
        <el-form-item label="电话" prop="tel">
          <el-input v-model="form.tel" placeholder="请输入电话" />
        </el-form-item>
        <el-form-item label="邮件" prop="email">
          <el-input v-model="form.email" placeholder="请输入邮件" />
        </el-form-item>
        <el-form-item label="项目承担单位意见" prop="hostUnitOpinion">
          <el-input v-model="form.hostUnitOpinion" placeholder="请输入项目承担单位意见" />
        </el-form-item>
        <el-form-item label="行政主管部门意见" prop="authUnitOpinion">
          <el-input v-model="form.authUnitOpinion" placeholder="请输入行政主管部门意见" />
        </el-form-item>
        <el-form-item label="深圳市住房和建设局" prop="mainUnitOpinion">
          <el-input v-model="form.mainUnitOpinion" placeholder="请输入深圳市住房和建设局" />
        </el-form-item>
        <el-form-item label="标准规范种类" prop="stdTp">
          <el-input v-model="form.stdTp" placeholder="请输入标准规范种类" />
        </el-form-item>
        <el-form-item label="原主编单位意见(若非原主编单位)" prop="exOpinion">
          <el-input v-model="form.exOpinion" placeholder="请输入原主编单位意见(若非原主编单位)" />
        </el-form-item>
        <el-form-item label="标准规范立项单位" prop="stdUnit">
          <el-input v-model="form.stdUnit" placeholder="请输入标准规范立项单位" />
        </el-form-item>
        <el-form-item label="目的、意义及必要性" prop="goalDesc">
          <el-input v-model="form.goalDesc" placeholder="请输入目的、意义及必要性" />
        </el-form-item>
        <el-form-item label="立项通知流程的当前状态(待办、退回、办理中、已完成)">
          <el-radio-group v-model="form.wStatus">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="国内外情况简要说明/涵盖范围和主要内容说明" prop="infosDesc">
          <el-input v-model="form.infosDesc" placeholder="请输入国内外情况简要说明/涵盖范围和主要内容说明" />
        </el-form-item>
        <el-form-item label="范围和主要技术内容" prop="techDesc">
          <el-input v-model="form.techDesc" placeholder="请输入范围和主要技术内容" />
        </el-form-item>
        <el-form-item label="可行性分析" prop="analysisDesc">
          <el-input v-model="form.analysisDesc" placeholder="请输入可行性分析" />
        </el-form-item>
        <el-form-item label="是否涉及专利等知识产权问题" prop="propertyDesc">
          <el-input v-model="form.propertyDesc" placeholder="请输入是否涉及专利等知识产权问题" />
        </el-form-item>
        <el-form-item label="主编单位资格条件情况说明" prop="hostUnitDesc">
          <el-input v-model="form.hostUnitDesc" placeholder="请输入主编单位资格条件情况说明" />
        </el-form-item>
        <el-form-item label="有无国家、本省本市法律法规、规范、政策和重点工作部署相关依据的情况说明" prop="lawDesc">
          <el-input v-model="form.lawDesc" placeholder="请输入有无国家、本省本市法律法规、规范、政策和重点工作部署相关依据的情况说明" />
        </el-form-item>
        <el-form-item label="有无相关国家标准、行业标准、地方标准情况说明" prop="stdDesc">
          <el-input v-model="form.stdDesc" placeholder="请输入有无相关国家标准、行业标准、地方标准情况说明" />
        </el-form-item>
        <el-form-item label="与国内相关标准对标情况的综合说明" prop="countryDesc">
          <el-input v-model="form.countryDesc" placeholder="请输入与国内相关标准对标情况的综合说明" />
        </el-form-item>
        <el-form-item label="与国际相关标准对标情况的综合说明" prop="foreignDesc">
          <el-input v-model="form.foreignDesc" placeholder="请输入与国际相关标准对标情况的综合说明" />
        </el-form-item>
        <el-form-item label="对标或借鉴的国际、国外或区域性" prop="foreignStdList">
          <el-input v-model="form.foreignStdList" placeholder="请输入对标或借鉴的国际、国外或区域性" />
        </el-form-item>
        <el-form-item label="涉及的科研成果鉴定、验证或认可情况说明" prop="achievementDesc">
          <el-input v-model="form.achievementDesc" placeholder="请输入涉及的科研成果鉴定、验证或认可情况说明" />
        </el-form-item>
        <el-form-item label="先进性、创新性和因地制宜等情况说明" prop="advanceDesc">
          <el-input v-model="form.advanceDesc" placeholder="请输入先进性、创新性和因地制宜等情况说明" />
        </el-form-item>
        <el-form-item label="工作经费安排情况说明" prop="fundsDesc">
          <el-input v-model="form.fundsDesc" placeholder="请输入工作经费安排情况说明" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
        <el-button type="primary" @click="submitForm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listM, getM, delM, addM, updateM, exportM } from "@/api/standard/m";

export default {
  name: "M",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 立项通知（市监）表格数据
      mList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userid: null,
        wid: null,
        nname: null,
        eunit: null,
        pctm: null,
        ld: null,
        partUnit: null,
        ldp: null,
        isHostUnit: null,
        ldu: null,
        projectName: null,
        keyword: null,
        majorValue: null,
        functionValue: null,
        standardNature: null,
        standardStatus: null,
        enName: null,
        tp: null,
        standardNo: null,
        hostUnit: null,
        planTime: null,
        pi: null,
        post: null,
        tel: null,
        email: null,
        hostUnitOpinion: null,
        authUnitOpinion: null,
        mainUnitOpinion: null,
        stdTp: null,
        exOpinion: null,
        stdUnit: null,
        goalDesc: null,
        wStatus: null,
        infosDesc: null,
        techDesc: null,
        analysisDesc: null,
        propertyDesc: null,
        hostUnitDesc: null,
        lawDesc: null,
        stdDesc: null,
        countryDesc: null,
        foreignDesc: null,
        foreignStdList: null,
        achievementDesc: null,
        advanceDesc: null,
        fundsDesc: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        userid: [
          { required: true, message: "用户id不能为空", trigger: "blur" }
        ],
        wid: [
          { required: true, message: "工作流节点id不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询立项通知（市监）列表 */
    getList() {
      this.loading = true;
      listM(this.queryParams).then(response => {
        this.mList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        nid: null,
        userid: null,
        wid: null,
        nname: null,
        eunit: null,
        pctm: null,
        ld: null,
        partUnit: null,
        ldp: null,
        isHostUnit: null,
        ldu: null,
        projectName: null,
        keyword: null,
        majorValue: null,
        functionValue: null,
        standardNature: null,
        standardStatus: "0",
        enName: null,
        tp: null,
        standardNo: null,
        hostUnit: null,
        planTime: null,
        pi: null,
        post: null,
        tel: null,
        email: null,
        hostUnitOpinion: null,
        authUnitOpinion: null,
        mainUnitOpinion: null,
        stdTp: null,
        exOpinion: null,
        stdUnit: null,
        goalDesc: null,
        wStatus: "0",
        infosDesc: null,
        techDesc: null,
        analysisDesc: null,
        propertyDesc: null,
        hostUnitDesc: null,
        lawDesc: null,
        stdDesc: null,
        countryDesc: null,
        foreignDesc: null,
        foreignStdList: null,
        achievementDesc: null,
        advanceDesc: null,
        fundsDesc: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.nid)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加立项通知（市监）";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const nid = row.nid || this.ids
      getM(nid).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改立项通知（市监）";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.nid != null) {
            updateM(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addM(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const nids = row.nid || this.ids;
      this.$confirm('是否确认删除立项通知（市监）编号为"' + nids + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delM(nids);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有立项通知（市监）数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportM(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>
